package com.py.credit.service;

import com.py.credit.common.rest.RestServiceResult;
import com.py.credit.entity.LyObj;
import com.py.credit.entity.TreeObj;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface LyService {

    List<TreeObj> selectCswhTreeList(String jclb, String name);

    List<TreeObj> selectGgCswhTreeList(String jclb, String name);

    List<Map<String, String>> selectLyList(String type);

    List<TreeObj> selectLyTreeList(String type, String name);
    List<TreeObj> selectLyTreeListByLy(String type, String name);
    List<TreeObj> selectLyTreeListByCs(String type, String name);

    List<TreeObj> selectDeptTreeList(String type, String name);
    List<TreeObj> selectDeptTreeListByDept(String type, String name);
    List<TreeObj> selectDeptTreeListByMeas(String type, String name);

    /**
     * 添加分类
     *
     * @param name
     * @param code
     * @param type
     * @param pId
     * @param sort
     */
    void add(String name, String code, String type, int pId, int rId, int sort);

    /**
     * 判断是否有相同的code
     *
     * @param code
     */
    int selectSameCode(String id, String name, String code);

    /**
     * 删除
     */
    RestServiceResult del(String type, String id);

    void update(String id, String name, String code, String type, int pId, int rId, int sort);

    LyObj selectLy(String id);

    boolean findTreeObj(List<TreeObj> treeObjs, String id);

    void excelExport(HttpServletResponse response, String type);
}
